This application is based on Japanese Patent Application No. 10-45289, filed Feb. 26, 1998, the contents of which is incorporated herein by reference.
The present invention relates to a computer system and a data saving/resuming method for the system and, more particularly, to a computer system having a hybernation function of saving the contents of a memory of the computer system in an I/O device such as a hard disk or the like, and a data saving/resuming method used for executing that hybernation, and resuming from the hybernation.
In recent years, hybernation is beginning to be used as a new power save mode in place of the suspend mode. In the hybernation mode, the contents of the main memory upon system power OFF are saved in a hard disk, and all the devices in the system go power-down. In this mode, consumption power can be lower than that in the suspend mode.
Along with recent improvements in the functions of the operating system and application programs, the memory capacity mounted as a main memory in the computer system is increasing. As the storage capacity of the main memory increases, the time required for saving the contents of the main memory in the hard disk becomes longer.
For this reason, in the system with the hybernation function, the time required for hybernation, i.e., the time from when the user or operating system issues a hybernation request until the system actually goes power OFF tends to increase.
In general, in the hybernation mode, the hard disk must be accessed a plurality of number of times so as to save all the memory data. Since the conventional system has a mechanism of detecting the end of a write to the hard disk using polling, a polling process must be periodically made while a local write is made in the hard disk, after command transmission.
For this reason, a process required for the next hard disk access such as command preparation or the like cannot be made during the write to the hard disk, and a process delay is produced due to so-called I/O wait.
It is an object of the present invention to provide a computer system which can save/resume memory data at high speed by reducing the memory data volume to be saved in an I/O device without increasing the time required for the overall saving process by a compression process, by compressing the next data to be written while a write access is locally made by the I/O device, and a data saving/resuming method for the system.
In order to achieve the above object, according to the present invention, a computer system having a memory and I/O device, comprises data compression means for compressing data on the memory, and write access means for repetitively write-accessing the I/O device to save the memory data compressed by the data compression means in the I/O device, and is characterized in that memory data to be written in the I/O device by the next write access is compressed during a write period of the I/O device, which starts in response to the write access.
According to this computer system, since the next write data is compressed during the period in which a local write is made by the I/O device, the compression process can reduce the memory data volume to be saved in the I/O device without increasing the time required for the overall saving process. Hence, since memory data can be saved at high speed, high-speed hybernation can be assured by applying the saving method of the present invention to the hybernation.
Also, the present invention is characterized in that a write command required for executing the next write access is prepared during the period in which a local write is made by the I/O device. In this way, the command for the next write access can be immediately transmitted upon completion of a write in response to the first write access, thus further shortening the saving process time.
Furthermore, the present invention is characterized in that the write access means is implemented using interrupt means, and the control is passed from the write access means to the data compression means upon completion of the write access by the write access means, and the control is passed from the data compression means to the write access means again in response to an interrupt signal generated by the I/O device, which indicates completion of the write. By task switching using an interrupt process, parallel processes of write access and data compression can be efficiently done.
Moreover, the present invention is characterized by further comprising read access means for repetitively read-accessing the I/O device to read out the compressed memory data from the I/O device, and data decompression means for decompressing the compressed data read out from the I/O device and mapping the decompressed data on the memory, and in that the compressed data that has already been read out from the I/O device in response to the previous read access is decompressed by the data decompression means during a read period of the I/O period, which starts in response to the read access. In this fashion, since the previously readout data is decompressed during the period in which a local read is made by the I/O device, thus resuming the saved data at high speed.
As described above, according to the present invention, since the next write data is compressed during the period in which a local write is made by the I/O device, the memory data volume to be saved in the I/O device can be reduced without increasing the time required for the overall saving process by the compression process, and the memory data can be saved/resumed at high speed.
Additional objects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objects and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out hereinafter.